package com.chinasofti.exceptiondemo;

import java.text.ParseException;

public class Student {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (age > 18 || age <25){
            this.name = name;
        }else {
            throw new RuntimeException("超出范围");
        }

    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
